<!DOCTYPE html>
<html lang="zh-CN">
<head>
	<meta charset="UTF-8">
	<meta content="IE=edge" http-equiv="X-UA-Compatible">
	<meta content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width" name="viewport">
	<title>传统题配置 - UOJ部署指北</title>

	<!-- css -->
	<link href="/css/base.min.css" rel="stylesheet">
	<link href="/css/project.min.css" rel="stylesheet">
	<link href="/css/styles.css" rel="stylesheet">
	<link href="/css/gitalk.css" rel="stylesheet">

</head>
<body class="page-brand">
	
	<header class="header header-transparent header-waterfall ui-header">
		<ul class="nav nav-list pull-left">
			<li>
				<a data-toggle="menu" href="#menu">
					<span class="icon icon-lg">menu</span>
				</a>
			</li>
		</ul>
		<a class="header-logo header-affix-hide margin-left-no margin-right-no" data-offset-top="213" data-spy="affix">传统题配置</a>
		<span class="header-logo header-affix margin-left-no margin-right-no" data-offset-top="213" data-spy="affix">传统题配置</span>

		<ul class="nav nav-list pull-right">
			<li>
				<a data-toggle="menu" href="/">
					<span class="avatar avatar-sm"><img alt="logo" src="/img/logo.png"></span>
				</a>
			</li>
		</ul>

	</header>

	<nav aria-hidden="true" class="menu" id="menu" tabindex="-1">
		<div class="menu-scroll">
			<div class="menu-content">
				<a class="menu-logo" href="/">UOJ部署指北</a>
				<ul class="nav">
					<li>
					
						
							
							
								<a class="collapsed waves-attach waves-effect" data-toggle="collapse" href="#入门">入门</a>	
								<ul class="menu-collapse collapse in" id="入门">

								<li>
									<a class="waves-attach" href="/post/安装.html">安装</a>
								</li><li>
									<a class="waves-attach" href="/post/维护.html">维护</a>
								</li><li>
									<a class="waves-attach" href="/post/外网映射教程.html">外网映射教程</a>
								</li><li>
									<a class="waves-attach" href="/post/系统管理.html">系统管理</a>
								</li></ul>
								<a class="collapsed waves-attach waves-effect" data-toggle="collapse" href="#题目">题目</a>	
								<ul class="menu-collapse collapse in" id="题目">

								<li>
									<a class="waves-attach" href="/post/题目管理概述.html">题目管理概述</a>
								</li><li class="active">
									<a class="waves-attach" href="/post/传统题配置.html">传统题配置</a>
								</li><li>
									<a class="waves-attach" href="/post/特殊需求配置.html">特殊需求配置</a>
								</li><li>
									<a class="waves-attach" href="/post/数据检验器.html">数据检验器</a>
								</li><li>
									<a class="waves-attach" href="/post/答案检查器.html">答案检查器</a>
								</li></ul>
								<a class="collapsed waves-attach waves-effect" data-toggle="collapse" href="#开发">开发</a>	
								<ul class="menu-collapse collapse in" id="开发">

								<li>
									<a class="waves-attach" href="/post/SVN简易指北.html">SVN简易指北</a>
								</li><li>
									<a class="waves-attach" href="/post/本地构建镜像.html">本地构建镜像</a>
								</li><li>
									<a class="waves-attach" href="/post/贡献.html">贡献</a>
								</li></ul>
								<a class="collapsed waves-attach waves-effect" data-toggle="collapse" href="#关于">关于</a>	
								<ul class="menu-collapse collapse in" id="关于">

								<li>
									<a class="waves-attach" href="/post/关于.html">关于</a>
								</li></ul>						


					</li>
					
				</ul>
			</div>
		</div>
	</nav>
	<main class="content">
		<div class="content-header ui-content-header">
			<div class="container">
				<tit class="content-heading">传统题配置</tit>
			</div>
		</div>
		<div class="container">
			<section class="content-inner margin-top-no">
				<div class="row">
					<div class="col-lg-13 col-md-13">
						<div class="card margin-bottom-no">
							<div class="card-main">
								<div class="card-inner page-card-inner">
						<h2>数据</h2>
<p>对于传统题，您上传的<code>×.zip</code>数据包应当包括这些内容：</p>
<ul>
<li>题目配置文件</li>
<li>测试数据</li>
<li>额外测试数据（包括题面中所给的测试样例）</li>
<li>（开启 hack）数据检验器</li>
<li>（开启 hack）标准程序</li>
</ul>
<h2>题目配置文件</h2>
<p>题目配置文件应当命名为<code>problem.conf</code>。这是一份配置的样例：</p>
<div class="codehilite"><pre><span></span>n_tests 10
n_ex_tests 1
n_sample_tests 1
input_pre www
input_suf in
output_pre www
output_suf out
time_limit 1
memory_limit 512
output_limit 64
use_builtin_judger on
use_builtin_checker ncmp
</pre></div>


<h3>测试点</h3>
<div class="codehilite"><pre><span></span>n_tests 10
n_ex_tests 1
n_sample_tests 1
</pre></div>


<p>这三行分别代表标准测试点、额外测试点和测试样例的数量。其中，额外测试点的前几个一定是测试样例，所以你必须把题目中给出的测试样例放到额外测试点当中。</p>
<p>UOJ 的 extra test 是指在 AC 的情况下会测额外数据，如果某个额外数据通不过会被倒扣3分。</p>
<div class="codehilite"><pre><span></span>input_pre www
input_suf in
output_pre www
output_suf out
</pre></div>


<p>这四行分别指明了每个测试点输入文件的前缀、扩展名、输出文件的前缀、扩展名。</p>
<p>标准测试点的文件名应当形如：<code>www1.in</code>、<code>www1.out</code>、<code>www2.in</code>、<code>www2.out</code>……</p>
<p>额外测试点的文件名应当形如：<code>ex_www1.in</code>、<code>ex_www1.out</code>、<code>ex_www2.in</code>、<code>ex_www2.out</code>……</p>
<h3>限制</h3>
<div class="codehilite"><pre><span></span>time_limit 1
memory_limit 512
output_limit 64
</pre></div>


<p>这三行配置了评测时对选手程序的时间限制、内存空间限制和输出限制。</p>
<p>时间限制的单位为秒，不能为小数。内存空间和输出限制的单位为 MB。</p>
<h3>校验器（checker）</h3>
<p>校验器用来检查选手程序的输出是否正确。</p>
<div class="codehilite"><pre><span></span>use_builtin_judger on
use_builtin_checker ncmp
</pre></div>


<p>第一行表示使用内建校验器，第二行表示使用的校验器类型。testlib 提供了很多奇奇怪怪的校验器。</p>
<table class="table">
<thead>
<tr>
<th>校验器</th>
<th>功能</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>ncmp</code></td>
<td>（单行整数序列）比较有序64位整数序列</td>
</tr>
<tr>
<td><code>wcmp</code></td>
<td>（单行字符串序列）比较字符串序列</td>
</tr>
<tr>
<td><code>fcmp</code></td>
<td>（多行数据）逐行进行全文比较，<strong>不忽略行末空格</strong>，忽略文末回车。</td>
</tr>
<tr>
<td><code>icmp</code></td>
<td>比较单个整数</td>
</tr>
<tr>
<td><code>ncmp</code></td>
<td>（单行整数序列）比较有序64位整数序列</td>
</tr>
<tr>
<td><code>uncmp</code></td>
<td>（单行整数序列）比较无序64位整数序列，即排序后比较</td>
</tr>
<tr>
<td><code>acmp</code>或<code>rcmp</code></td>
<td>比较单个双精度浮点数，最大绝对误差为 1.5e-6</td>
</tr>
<tr>
<td><code>dcmp</code></td>
<td>比较单个双精度浮点数，最大绝对或相对误差为 1.0e-6</td>
</tr>
<tr>
<td><code>rcmp4</code></td>
<td>比较双精度浮点数序列，最大绝对或相对误差为 1.0e-4</td>
</tr>
<tr>
<td><code>rcmp6</code></td>
<td>比较双精度浮点数序列，最大绝对或相对误差为 1.0e-6</td>
</tr>
<tr>
<td><code>rcmp9</code></td>
<td>比较双精度浮点数序列，最大绝对或相对误差为 1.0e-9</td>
</tr>
<tr>
<td><code>rncmp</code></td>
<td>比较双精度浮点数序列，最大绝对误差为 1.5e-5</td>
</tr>
<tr>
<td><code>hcmp</code></td>
<td>比较单个有符号大整数</td>
</tr>
<tr>
<td><code>lcmp</code></td>
<td>逐行逐字符串进行全文比较，多个空白字符视为一个</td>
</tr>
<tr>
<td><code>caseicmp</code></td>
<td>多组数据，比较单个整数，输出形如：<code>Case &lt;caseNumber&gt;: &lt;number&gt;</code></td>
</tr>
<tr>
<td><code>casencmp</code></td>
<td>多组数据，比较整数序列，输出形如：<code>Case &lt;caseNumber&gt;: &lt;number&gt; &lt;number&gt; ... &lt;number&gt;</code></td>
</tr>
<tr>
<td><code>casewcmp</code></td>
<td>多组数据，比较字符串序列，输出形如：<code>Case &lt;caseNumber&gt;: &lt;token&gt; &lt;token&gt; ... &lt;token&gt;</code></td>
</tr>
<tr>
<td><code>yesno</code></td>
<td>比较单个<code>YES</code>和<code>NO</code></td>
</tr>
</tbody>
</table>
<h3>其他</h3>
<p>您还可以在管理界面通过<code>试题配置</code>按钮进行配置。</p>
								<hr>

								<!-- Gitalk 评论框 start -->
								<div id="gitalk-container"></div>
								<!-- Gitalk 评论框 end -->

								</div>
							</div>
						</div>
					</section>
				</div>
			</div>

			
			<hr>
			<center>[CC协议 BY-NC-SA] 署名 - 非商业性使用 - 相同方式共享  @ UOJ部署指北 2018</center>

		</div>


	</main>
	
	<div class="fbtn-container">
		<div class="fbtn-inner">
			<a class="fbtn fbtn-lg fbtn-brand-accent waves-attach waves-circle waves-light" data-toggle="dropdown">
				<span class="fbtn-text fbtn-text-left">Home</span>
				<span class="fbtn-ori icon">apps</span>
				<span class="fbtn-sub icon">close</span>
			</a>
			<div class="fbtn-dropup">
				<a class="fbtn waves-attach waves-circle" href="https://github.com/UniversalOJ/UniversalOJ.github.io/issues" target="_blank">
					<span class="fbtn-text fbtn-text-left">反馈</span><span class="icon">feedback</span>
				</a>
				<a class="fbtn fbtn-green waves-attach waves-circle" href="/" target="_self">
					<span class="fbtn-text fbtn-text-left">返回主页</span><span class="icon">home</span>
				</a>
			</div>
		</div>
	</div>

	

	<!-- js -->
	<script src="/js/jquery.min.js"></script>
	<script src="/js/base.min.js"></script>
    
    <!-- Gitalk JS 代码 start -->
    <script src="/js/gitalk.min.js"></script>
    <script>
    const gitalk = new Gitalk({
      clientID: '0dc093a9aefa1d501df2',
      clientSecret: '3639aabd1bc6b0d9b543be1f13b6bcb2bf7364af',
      repo: 'UniversalOJ.github.io',
	  id: location.pathname,
      owner: 'UniversalOJ',
      admin: ['cebarobot', 'MascoSkray', 'Ruanxingzhi', 'billchenchina'],
      labels: [],
    })
    
    gitalk.render('gitalk-container')
    </script>
    <!-- Gitalk JS 代码 end -->
    
</body>
</html>
